<@t.plat_body pageid="optrators">
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables.min.js"></script>
<script type="text/javascript" src="${base}/js/plugins/datatables/datatables_basic.js"></script>
<div class="panel panel-flat">
    <div class="panel-heading">
        <h5 class="panel-title">操作员</h5>
        <div class="heading-elements">
            <a class="btn btn-primary" onclick="dialogBox('${base}/plat/optor/optratorsAdd', '添加操作员', 450, 350);" href="javascript:void(0)"><i class="icon-add position-left"></i>添加</a>
        </div>
    </div>

    <table class="table table-striped table-bordered datatable-basic" id="userTable">
    </table>
</div>
<script>
    function delRec(id) {
        createConfirm('您确定要删除该数据', function () {
            post('pl/operator/del', {opercode: id}, function (result) {
                if (result.code == 0) {
                    table.ajax.reload();
                } else {
                    alertError(result.message);
                }
            });
        });
    }
    var table;
    $(function () {
        table=simpleTable('userTable', [
            {
                dataIndex: 'opercode',
                title: "操作员代码"
            },
            {
                dataIndex: 'opername',
                title: "操作员姓名"
            },
            {
                dataIndex: 'flag',
                title: "是否启用",
                render:function (data) {
                    if(data[0]=='0'){
                        return '否';
                    }else if(data[0]=='1'){
                        return '是';
                    }
                }
            },
            {
                dataIndex: 'chgdate',
                title: "最后登录时间",
                type:'datetime'
            },
            {
                sWidth:240,
                title: "操作",
                dataIndex: 'opercode',
                sClass:'text-center',
                render: function (data, type, full) {
                    var html = '<div>';
                    html+='<a style="margin-left: 2px" href="javascript:void(0)" onclick="dialogBox(\'${base}/changePwd?code='+data+'\', \'修改密码\', 600, 300);" class="btn bg-purple-400 btn-xs btn-outline">修改密码</a>';
                    html+='<a style="margin-left: 2px" href="javascript:void(0)" onclick="dialogBox(\'${base}/plat/optor/optratorsAdd?code='+data+'\', \'编辑角色\', 450, 350);" class="btn btn-success btn-xs btn-outline">编辑</a>';
                    html+='<a href="javascript:void(0)" style="margin-left: 2px" onclick="delRec(\''+data+'\')" class="btn btn-primary btn-xs btn-outline">删除</a>';
                    html+='</div>';
                    return html;
                }
            }
        ], {
            bAutoWidth:false,
            searching: true,
            bLengthChange: false,
            bSort: false,
            url: '${base}/pl/operator/list',
            pageLength: 10

        });
    });
</script>
</@t.plat_body>
